import request from '@/utils/request'
const api_name = '/admin/system/sysUser/'
export default {
    getPageList(page, limit, searchObj) {
        return request({
            url: `${api_name}${page}/${limit}`,
            method: 'get',
            params: searchObj
        })
    },
    removeById(id) {
        return request({
            url: `${api_name}remove/${id}`,
            method: 'delete'
        })
    },
    saveUser(user) {
        return request({
            url: `${api_name}save`,
            method: 'post',
            data: user
        })
    },
    getById(id) {
        return request({
            url: `${api_name}findUserById/${id}`,
            method: 'get'
        })
    }, updateUser(user) {
        return request({
            url: `${api_name}update`,
            method: 'post',
            data: user
        })
    }, batchRemove(ids) {
        return request({
            url: `${api_name}batchRemove`,
            method: 'delete',
            data: ids
        })
    }, updateStatus(id, status) {
        return request({
            url: `${api_name}updateStatus/${id}/${status}`,
            method: 'get'
        })
    }, getRolesById(id) {
        return request({
            url: `${api_name}toAssign/${id}`,
            method: 'get'
        })
    }, assignRoles(assignRoleVo) {
        return request({
            url: `${api_name}doAssign`,
            method: 'post',
            data: assignRoleVo
        })
    }
}